<?php
/*
** loading Franchise of day at homepage
Author: Najeeb (ceo@najeebmedia.com)
*/
$args = array('cat' => 90);
query_posts($args);
?>

<h2>Franchises of the Day</h2>
	<?php if ( have_posts() ) : ?>
            <?php while ( have_posts() ) : the_post(); ?>
            <div class="each-post">
              <h3><a href="post-detail-page/?pid=<?php echo the_ID(); ?>"><?php echo the_title(); ?></a></h3>
				<?php 
                if (has_post_thumbnail()):  // check if the post has a Post Thumbnail assigned to it.
				?>
                  <a href="post-detail-page/?pid=<?php echo the_ID(); ?>"><?php the_post_thumbnail("search-listing"); ?></a>
                <?php
                else: 
                ?>
                <a href="post-detail-page/">
                <img style="width:200px" src="http://www.franquicia-t.com/wp-content/uploads/2012/02/200px-No_image_available.svg_.png" /></a>
                <?php endif; ?>
              <p><?php echo the_excerpt(); ?></p>
              <div class="clearfix"></div>
            </div>
           <?php endwhile; ?>
    
    <?php else: ?>
        <div class="each-post">
          <h3>No Posts Found.</h3>
          <div class="clearfix"></div>
        </div>    
    <?php endif; ?>
	